<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>父组件向子组件传递数据</title>
</head>
<body>
<div id="app">
    <!--  传入的是静态数据，即非变量  -->
    <cpn message="Hello, World!"></cpn>
    <!--  传入冬天参数，即变量  -->
    <cpn v-bind:message="info"></cpn>

</div>

<template id="cpn">
    <h1>来自组附件的消息：{{ message }}</h1>
</template>


<script type="module">
    import {createApp, ref} from "../../../../js/vue.esm-browser.js";
    import {defineComponent} from "../../../../js/vue.esm-browser.js";

    let cpn = defineComponent(
        {
            template: "#cpn",
            props: ["message"],

        }
    );


    let app = createApp({
        setup() {
            let info = ref("Hi， Vue！")
            return {
                info,
            }
        },
        components: {
            cpn,
        }
    })

    app.mount("#app")
</script>
</body>
</html>